package top.ywlog.permission.config;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;

/**
 * @author: Durian
 * @date: 2020/10/24 17:51
 * @description: 错误页面配置
 */
@Configuration
public class ErrorPageConfig implements ErrorPageRegistrar
{
    @Override
    public void registerErrorPages(ErrorPageRegistry registry)
    {
        registry.addErrorPages(
//                new ErrorPage(HttpStatus.FORBIDDEN, "/403"),
                new ErrorPage(HttpStatus.NOT_FOUND, "/error/404.html")
                /*new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500")*/);
    }
}
